home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _64DA77695C7F4B2886612C3BDE691834 < prev    next >
Encoding:
Text File  |  2004-01-06  |  4.8 KB  |  162 lines

  1. AIBehaviour.TestCase = {
  2.     Name = "TestCase",
  3.     first = 0,
  4.  
  5.  
  6.     Properties = {
  7.  
  8.         fileLajno     = "lalal",
  9.         shit        = 1,
  10.         },
  11.  
  12.  
  13.     -- SYSTEM EVENTS            -----
  14.     ---------------------------------------------
  15.     OnSpawn = function(self , entity )
  16.         
  17.         AI:CreateGoalPipe("goodold");
  18.         AI:PushGoal("goodold","firecmd",0,1);
  19.         AI:PushGoal("goodold","run",0,1);
  20.         AI:PushGoal("goodold","timeout",1,1);
  21.         AI:PushGoal("goodold","hide",1,10,HM_NEAREST);
  22.         --AI:PushGoal("goodold","signal",1,1,"PING_PONG",0);
  23.  
  24.         AI:CreateGoalPipe("pingpong");
  25.         AI:PushGoal("pingpong","hide",1,10,HM_LEFTMOST_FROM_TARGET);
  26.         AI:PushGoal("pingpong","signal",1,1,"waitrandom",0);
  27.         AI:PushGoal("pingpong","hide",1,10,HM_RIGHTMOST_FROM_TARGET);
  28.         AI:PushGoal("pingpong","signal",1,1,"waitrandom",0);
  29.  
  30.     
  31.         AI:CreateGoalPipe("strafell");
  32.         AI:PushGoal("strafell","strafe",0,1);
  33.         AI:PushGoal("strafell","timeout",1,0.5);
  34.         AI:PushGoal("strafell","strafe",0,0);
  35.         AI:PushGoal("strafell","timeout",1,5);
  36.         AI:PushGoal("strafell","signal",1,1,"PING_PONG",0);
  37.         
  38.  
  39.         -------------------crate stuff
  40.         AI:CreateGoalPipe("crate_maneuver");
  41.         AI:PushGoal("crate_maneuver","locate",0,"pickup");
  42.         AI:PushGoal("crate_maneuver","acqtarget",0,"");
  43.         AI:PushGoal("crate_maneuver","timeout",1,1);
  44.         AI:PushGoal("crate_maneuver","approach",1,2);
  45.         AI:PushGoal("crate_maneuver","locate",0,200);
  46.         AI:PushGoal("crate_maneuver","acqtarget",0,"");
  47.         AI:PushGoal("crate_maneuver","approach",1,1);
  48.         AI:PushGoal("crate_maneuver","signal",0,1,"BIND_CRATE_TO_ME",0);
  49.         AI:PushGoal("crate_maneuver","locate",0,"drop");
  50.         AI:PushGoal("crate_maneuver","acqtarget",0,"");
  51.         AI:PushGoal("crate_maneuver","timeout",1,1);
  52.         AI:PushGoal("crate_maneuver","approach",1,2);
  53.         AI:PushGoal("crate_maneuver","signal",0,1,"UNBIND_CRATE",0);
  54.  
  55.         entity:SelectPipe(0,"crate_maneuver");
  56.     
  57.     end,
  58.  
  59.  
  60.     BIND_CRATE_TO_ME = function( self,entity, sender )
  61.         self.CRATE = AI:GetAttentionTargetOf(entity.id);
  62.         if (self.CRATE) then
  63.             self.CRATE:SetPos({x=0,y=0,z=2});
  64.             self.CRATE:SetAngles({x=0,y=0,z=0});
  65.             entity:Bind(self.CRATE);
  66.         end
  67.     end,
  68.     UNBIND_CRATE = function( self,entity, sender )
  69.         if (self.CRATE) then
  70.             local mypos = entity:GetPos();
  71.             mypos.x = mypos.x - 2;
  72.             mypos.z = mypos.z + 2;
  73.             entity:Unbind(self.CRATE);            
  74.             self.CRATE:SetPos(mypos);
  75.             self.CRATE:SetAngles({x=0,y=0,z=0});
  76.             self.CRATE:AwakePhysics(1);
  77.         end
  78.     end,
  79.  
  80.  
  81.     ---------------------------------------------
  82.     PING_PONG = function( self,entity, sender )
  83.         entity:SelectPipe(0,"pingpong");
  84.     end,
  85.     
  86.     waitrandom = function( self,entity, sender )
  87.  
  88.         local rnd = random(1,30);
  89.         rnd = rnd / 10;
  90.         
  91.         AI:CreateGoalPipe("time");
  92.         AI:PushGoal("time","timeout",1,rnd);
  93.  
  94.         System:LogToConsole("waiting for "..rnd);
  95.         entity:InsertSubpipe(0,"time");
  96.     end,    
  97.  
  98.     ---------------------------------------------
  99.     OnActivate = function(self, entity )
  100.     end,
  101.     ---------------------------------------------
  102.     OnNoTarget = function(self, entity )
  103.     end,
  104.     ---------------------------------------------
  105.     OnPlayerSeen = function(self, entity )
  106.         if (self.first == 0) then
  107.             entity:SelectPipe(0,"goodold");            
  108. self.first = 1;
  109.         end
  110.     end,
  111.     ---------------------------------------------
  112.     OnPlayerMemory = function(self, entity )
  113.     end,
  114.     ---------------------------------------------
  115.     OnEnemySeen = function(self, entity )
  116.     end,
  117.     ---------------------------------------------
  118.     OnEnemyMemory = function(self, entity )
  119.     end,
  120.     ---------------------------------------------
  121.     OnDeadFriendSeen = function(self,entity )
  122.     end,
  123.     ---------------------------------------------
  124.     OnDeadEnemySeen = function(self,entity )
  125.     end,
  126.     ---------------------------------------------
  127.     OnInterestingSoundHeard = function(self,entity )
  128.     end,
  129.     ---------------------------------------------
  130.     OnThreateningSoundHeard = function( self,entity )
  131.     end,
  132.     ---------------------------------------------
  133.     OnGunfireHeard = function(self,entity )
  134.     end,
  135.     ---------------------------------------------
  136.     OnFootstepsHeard = function(self, entity )
  137.     end,
  138.     ---------------------------------------------
  139.     OnGranateSeen = function(self, entity )
  140.     end,
  141.     ---------------------------------------------
  142.     OnLongTimeNoTarget = function(self, entity )
  143.     end,
  144.     ---------------------------------------------
  145.     OnDied = function( self,entity )
  146.     end,
  147.     ---------------------------------------------
  148.     OnGroupMemberDied = function( self,entity )
  149.     end,
  150.     ---------------------------------------------
  151.     ---------------------------------------------
  152.     OnNoNearerHidingPlace = function( self,entity , sender)
  153.     end,    
  154.     ---------------------------------------------
  155.     OnNoHidingPlace = function( self,entity, sender )
  156.     --    entity:SelectPipe(0,"strafell");
  157.         System:LogToConsole("NO HIDING!!!!!!!!!!!!");
  158.     end,    
  159.     
  160.  
  161.  
  162. }